import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { ApSyncService } from './ap_sync.service';

@Controller('ap/sync')
export class ApSyncController {
  constructor(private readonly apSyncService: ApSyncService) {}

  @Post('/auto')
  autoSync(@Body('is_auto') is_auto  : any) {
    return this.apSyncService.autoSync(is_auto);
  }

  @Post('/lon_store')
  postLonStore(@Body('lon_store') lon_store: any) {
    return this.apSyncService.postLonStore(lon_store);
  }

  @Post('/auto_get')
  postAutoGet() {
    return this.apSyncService.postAutoGet();
  }

  @Post('/lon_store_get')
  postLonStoreGet() {
    return this.apSyncService.postLonStoreGet();
  }


  @Post('/state')
  postState() {
    return this.apSyncService.postState();
  }

  // 获取选星
  @Post('/sate_get')
  postGetStar() {
    return this.apSyncService.postGetStar();
  }

  // 配置选星
  @Post('/sate_select')
  postSetStar(@Body('sate') sate: any) {
    return this.apSyncService.postSetStar(sate);
  }

  // 配置波束索引
  @Post('/beam_set')
  postSetBeamIndex(@Body('beam') beam: any) {
    console.log(beam,"beam")
    return this.apSyncService.postSetBeamIndex(beam);
  }

  // 获取波束索引
  @Post('/beam_get')
  postGetBeamIndex() {
    return this.apSyncService.postGetBeamIndex();
  }

  // 信标频率设置
  @Post('/bc_freq')
  postSetBcFreq(@Body('bc_freq') bc_freq: any) {
    return this.apSyncService.postSetBcFreq(bc_freq);
  }

  // 信标频率获取
  @Post('/bc_freq_get')
  postGetBcFreq() {
    return this.apSyncService.postGetBcFreq();
  }

  // 波束获取
  @Post('/freq_get')
  postGetFreq() {
    return this.apSyncService.postGetFreq();
  }


  // 波束设置
  @Post('/freq_set')
  postSetFreq(@Body() body: any) {
    return this.apSyncService.postSetFreq(body);
  }


  // 波束删除
  @Post('/freq_del')
  postDeletefreq(@Body() body: any) {
    return this.apSyncService.postDeletefreq(body);
  }
}
